package com.wenhuang.chatgptopen.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenhuang.chatgptopen.mapper.TopicMapper;
import com.wenhuang.chatgptopen.pojo.Topic;
import com.wenhuang.chatgptopen.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 *@Time：2023/6/3
 *@Author：Jelly
 */
@Service
public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements TopicService {
    @Autowired
    private TopicMapper topicMapper;

    @Override
    public Integer addContent(Topic topic) {
        return topicMapper.addContent(topic);
    }

    @Override
    public Integer deleteTopic(Topic topic) {
        return topicMapper.deleteTopic(topic);
    }

    @Override
    public List<Topic> selectTopicByUserId(Topic topic) {
        return topicMapper.selectTopicByUserId(topic);
    }

    @Override
    public Topic selectTopicByTitleAndUserId(Topic topic) {
        return topicMapper.selectTopicByTitleAndUserId(topic);
    }
}
